package reqdata

// RegisterReq 注册req
type RegisterReq struct {
	//账户密码
	Account  string `json:"account" example:"13488886666"` //账户
	Password string `json:"password" example:"123456"`     //密码

	Avatar   string `json:"avatar" example:"xxx"`    //头像
	Nickname string `json:"nickname" example:"demo"` //昵称
	Sex      int    `json:"sex" example:"0"`         //性别

	//手机号或邮箱验证
	PhoneEmailVerifyReq
}

// PhoneEmailSendReq 手机邮箱发送验证码
type PhoneEmailSendReq struct {
	Phone string `json:"phone" example:"13488886666"` //手机号，都传的情况下优先手机号
	Email string `json:"email" example:"123@qq.com"`  //邮箱
}

func (req PhoneEmailSendReq) Target() string {
	if req.Phone != "" {
		return req.Phone
	}
	return req.Email
}

// PhoneEmailVerifyReq 手机邮箱验证
type PhoneEmailVerifyReq struct {
	PhoneEmailSendReq

	Code string `json:"code" example:"123456"`
}
